package com.floreantpos.model.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the STORE_ITEM_REL table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="STORE_ITEM_REL"
 */

public abstract class BaseStoreItemRel  implements Serializable {

	public static String REF = "StoreItemRel";
	public static String PROP_ITEM = "Item";
	public static String PROP_NUMBER = "Number";
	public static String PROP_STORE_NAME = "StoreName";
	public static String PROP_ID = "Id";


	// constructors
	public BaseStoreItemRel () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseStoreItemRel (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String storeName;
	private java.lang.Integer number;

	// many to one
	private com.floreantpos.model.MenuItem item;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="ID"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: STORE_NAME
	 */
	public java.lang.String getStoreName () {
			return storeName;
	}

	/**
	 * Set the value related to the column: STORE_NAME
	 * @param storeName the STORE_NAME value
	 */
	public void setStoreName (java.lang.String storeName) {
		this.storeName = storeName;
	}



	/**
	 * Return the value associated with the column: NUMBER
	 */
	public java.lang.Integer getNumber () {
			return number == null ? Integer.valueOf(0) : number;
	}

	/**
	 * Set the value related to the column: NUMBER
	 * @param number the NUMBER value
	 */
	public void setNumber (java.lang.Integer number) {
		this.number = number;
	}



	/**
	 * Return the value associated with the column: ITEM_ID
	 */
	public com.floreantpos.model.MenuItem getItem () {
			return item;
	}

	/**
	 * Set the value related to the column: ITEM_ID
	 * @param item the ITEM_ID value
	 */
	public void setItem (com.floreantpos.model.MenuItem item) {
		this.item = item;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.floreantpos.model.StoreItemRel)) return false;
		else {
			com.floreantpos.model.StoreItemRel storeItemRel = (com.floreantpos.model.StoreItemRel) obj;
			if (null == this.getId() || null == storeItemRel.getId()) return false;
			else return (this.getId().equals(storeItemRel.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}